/**
 * 
 */
package com.adkfp.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.adkfp.action.ADKControllerAction;
import com.adkfp.bean.ADKAccessLogBean;
import com.adkfp.bean.ADKControllerBean;
import com.adkfp.dao.ADKControllerDaoMapper;
import com.adkfp.service.IADKControllerService;

/**
 * @author qwertyuiop
 *
 */
@Service("aDKControllerService")
public class ADKControllerImpl implements IADKControllerService{

	@Resource
	private ADKControllerDaoMapper aDKControllerMapper;
	@Override
	@Transactional
	public List<ADKControllerBean> findByCondition(ADKControllerBean bean) {
		return aDKControllerMapper.findByCondition(bean);
	}

	@Override
	@Transactional
	public long findByConditionCount(ADKControllerBean bean) {
		
		return aDKControllerMapper.findByConditionCount(bean);
	}

	@Override
	@Transactional
	public void insert(ADKControllerBean bean) {
		aDKControllerMapper.insert(bean);
		/*System.out.println("增加控制器时的autoID是："+bean.getAutoID());
		bean.setCtrlAddr(bean.getAutoID());
		aDKControllerMapper.updateCtrlAddr(bean);*/
		
	}

	//修改（查找id）
	@Override
	@Transactional
	public ADKControllerBean findById(int id) {
		return aDKControllerMapper.findById(id);
	}

	//删除
	@Override
	@Transactional
	public void delete(int id) {
		aDKControllerMapper.delete(id);
	}

	//修改
	@Override
	@Transactional
	public void update(ADKControllerBean bean) {
		aDKControllerMapper.update(bean);
		
	}
	
	
	//用于权限组设置-门权限
	@Override
	@Transactional
	public List<ADKControllerBean> ufindByCondition(ADKControllerBean bean) {
		return aDKControllerMapper.ufindByCondition(bean);
	}

	@Override
	public List<ADKControllerBean> afindByCondition(ADKControllerBean bean) {
		return aDKControllerMapper.afindByCondition(bean);
	}
	@Override
	@Transactional
	public long ufindByConditionCount(ADKControllerBean bean) {
		return aDKControllerMapper.ufindByConditionCount(bean);
	}
	@Override
	public long afindByConditionCount(ADKControllerBean bean) {
		return aDKControllerMapper.afindByConditionCount(bean);
	}

	@Override
	public ADKControllerBean finduseridById(Integer ctrlAddr) {
		return aDKControllerMapper.finduseridById(ctrlAddr);
	}

	@Override
	public int selectMax() {
		return aDKControllerMapper.selectMax();
	}

	//查询door和controller所有数据（FMY）
	@Override
	public ADKControllerBean findByIdToo(int id) {
		return aDKControllerMapper.findByIdToo(id);
	}
	// 增加门权限（@C）
	@Override
	public void insertDoorPowerGroup(Integer NetGroupID,Integer GroupID, Integer SubPointID,Integer CtrlAddr, Integer DoorAddr,Integer DoorTimeItemID) {
		// TODO Auto-generated method stub
		aDKControllerMapper.insertDoorPowerGroup(NetGroupID,GroupID, SubPointID, CtrlAddr, DoorAddr, DoorTimeItemID);
	}

	
}
